package com.event;

import org.springframework.context.ApplicationEvent;
//自定义事件
public class MyEvent extends ApplicationEvent {
    private String message;

    public MyEvent(Object source) {
        super(source);
    }

    public MyEvent(Object source, String message) {
        super(source);
        this.message = message;
        System.out.println("发布事件成功!事件message: "+this.message);
    }

    public String getMessage() {
        return message;
    }
}
